home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 45
/
Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso
/
Aminet
/
game
/
role
/
ldmud-3.2-bin.lha
/
mud
/
doc
/
efun
/
replace_program
< prev
next >
Wrap
Text File
|
2001-04-06
|
2KB
|
31 lines
SYNOPSIS
void replace_program(string program)
DESCRIPTION
Substitutes a program with an inherited one. This is useful if
you consider the performance and memory consumption of the
driver. A program which doesn't need any additional variables
and functions (except during creation) can call
replace_program() to increase the function-cache hit-rate of
the driver which decreases with the number of programs in the
system. Rooms are a good example for the application of this
function, as many rooms just consist of an inherit statement
and the configure function. Any object can call
replace_program() but looses all extra variables and functions
which are not defined by the inherited program.
When replace_program() takes effect, shadowing is stopped on
the object since 3.2@166.
It is not possible to replace the program of an object after
(lambda) closures have been bound to it. It is of course
possible to first replace the program and then bind lambda
closures to it.
The program replacement does not take place with the call to
the efun, but is merely scheduled to be carried out at the end
of the backend cycle. This may cause closures to have
references to then vanished lfuns of the object. This poses no
problem as long as these references are never executed after
they became invalid.